/**
 * @author 迷途小羔羊
 * 2019-5-6
 */
module GYLite
{
	export class GYByteArray extends egret.ByteArray{
		public constructor(buffer?: ArrayBuffer | Uint8Array) {
			super(buffer);
		}
		/**zlib算法解压 需要引用zlib.min.js*/
		public uncompress(algorithm:String="zlib"):void
		{let s = this;
			var inflate = new Zlib.Inflate(new Uint8Array(s.buffer));
			var inbuffer = inflate.decompress();
			s.buffer = inbuffer;//.buffer;
			s._position = 0;
		}
		/**zlib算法压缩 需要引用zlib.min.js*/
		public compress(algorithm:String="zlib"):void
		{let s = this;
			let deflate = new Zlib.Deflate(new Uint8Array(s.buffer));
			let inbuffer = deflate.compress();
			s.buffer=inbuffer;//.buffer;
			s._position = 0;
		}
	}
}